package com.aceitunaproject.shared.gamelement;

import com.aceitunaproject.shared.playerdata.PlayerData;
import java.io.Serializable;

/**
 *  Shared (communications) Superclass for the basic game elements (like Units, Settlements and installations).
 *  
 * @author Federico Bergstein
 */
public abstract class GameElement implements Serializable {

	private static final long serialVersionUID = 284581692352951460L;
	private Long id; 
	private String name;
	private PlayerData playerData;
	private int positionX;
	private int positionY;
	/**
	 * @param name of the element
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the name of the element
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param player that owns the element
	 */
	public void setPlayer(PlayerData player) {
		this.playerData = player;
	}

	/**
	 * @return the player that owns the element
	 */
	public PlayerData getPlayer() {
		return playerData;
	}
	/**
	 * @param id the element's id in the game world
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the element's id in the game world
	 */
	public Long getId() {
		return id;
	}
	
	public String toString()
	{
		return getName();
	}

	/**
	 * @param positionX the positionX to set
	 */
	public void setPositionX(int positionX) {
		this.positionX = positionX;
	}

	/**
	 * @return the positionX
	 */
	public int getPositionX() {
		return positionX;
	}

	/**
	 * @param positionY the positionY to set
	 */
	public void setPositionY(int positionY) {
		this.positionY = positionY;
	}

	/**
	 * @return the positionY
	 */
	public int getPositionY() {
		return positionY;
	}

	
	
}
